<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */
$intMqID = (int)$_data["MqID"];
$strSQL = "select * from `bet_LogMarquee` where MqID = ".$intMqID." order by ID desc limit 0, 100";
if(!$RS = PMA_mysql_query($strSQL, $$_Conn)){
	$GLOBALS["errormessage"] = $_strMarquee["ErrMessage"];//"系統發生錯誤, 請連絡工程師！";
	$GLOBALS["errorhidden"] = "\n Error: ".PMA_mysql_error($$_Conn).",\nSQL: ".$strSQL.",\nLine: ".__LINE__.",\nPage: ".__FILE__;
	ErrMsgOutputHTML("Error", "", 1);
}
$intTotal = PMA_mysql_num_rows($RS);

$fp = @file($strTemplatePath."LogList.html");
$fp = implode("", $fp);
$fp = setHTMLCharset($fp);

while(list($k, $v) = each($_strMarquee)){
	$fp = str_replace("{".$k."}", $v, $fp);
}

$fp = str_replace("{intTotal}", $intTotal, $fp);
//內容清單
$strCon = "";
$strTmp = "";
preg_match("/<!-- @ Content Start @ \/\/-->(.+)<!-- @ Content End @ \/\/-->/s", $fp, $arrCon);
while($Rows = PMA_mysql_fetch_object($RS)){
	$strAddDate = DateForm($Rows -> AddDate, $Rows -> AddTime, "m-d h:i");
	$Tmp = "Content_".$_intLang;
	$strTmp = str_replace("{ShowContent}", $Rows -> $Tmp, $arrCon[1]);
	$Tmp = ($Rows -> isPopup == 1)?$_strMarquee["_Yes"]:$_strMarquee["_Not"];//"是":"否";
	$strTmp = str_replace("{ShowisPopup}", $Tmp, $strTmp);
	$Tmp = ($Rows -> isOnline == 1)?$_strMarquee["_Yes"]:$_strMarquee["_Not"];//"是":"否";
	$strTmp = str_replace("{ShowisOnline}", $Tmp, $strTmp);
	$strTmp = str_replace("{ShowOnDate}", $Rows -> OnDate, $strTmp);
	$strTmp = str_replace("{ShowOffDate}", $Rows -> OffDate, $strTmp);
	$strTmp = str_replace("{ShowID}", $Rows -> ID, $strTmp);
	$strTmp = str_replace("{ShowAccount}", $Rows -> Account, $strTmp);
	$strTmp = str_replace("{ShowIP}", $Rows -> IP, $strTmp);
	$strTmp = str_replace("{ShowAddDate}", $strAddDate, $strTmp);
	switch($Rows -> LogType){
		case "0":
			$strTmp = str_replace("{ShowLogType}", $_strMarquee["_Add"], $strTmp);
			break;
		case "1":
			$strTmp = str_replace("{ShowLogType}", $_strMarquee["_EditSubmit"], $strTmp);
			break;
		case "2":
			$strTmp = str_replace("{ShowLogType}", $_strMarquee["_Del"], $strTmp);
			break;
	}
	$strCon .= $strTmp."\n";

}
$fp = preg_replace("/<!-- @ Content Start @ \/\/-->.+<!-- @ Content End @ \/\/-->/s", $strCon, $fp);

//輸出
WebOutputHTML($fp, 1);
?>